<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/28 0028
  Time: 20:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<style>
    table{
        text-align: center;
    }
</style>
    <table class="result-tab" width="100%">
        <tr>
            <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
            <th>ID</th>
            <th>标签名</th>
            <th>类型</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${requestScope.tagsPageInfo.list}" var="tags">
            <tr>
                <td class="tc"><input name="id[]" value="${tags.id}" id="choose" type="checkbox"></td>
                <td>${tags.id}</td>
                <td>${tags.tagName}</td>
                <td>${tags.parent.tagName}</td>
                <td><fmt:formatDate value="${tags.inputTime}" pattern="yyyy_MM-dd HH:mm:ss"></fmt:formatDate></td>
                <td>
                    <a class="link-update" href="#" id="${tags.id}">修改</a>
                    <a class="link-del" href="#" id="${tags.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div class="list-page">
        ${requestScope.tagsPageInfo.pages}页
        <a href="#" data-pagenum="1">首页 </a>
        <c:if test="${requestScope.tagsPageInfo.pageNum gt 1}">
            <a href="#" data-pagenum="${requestScope.tagsPageInfo.pageNum-1}">上一页</a>
        </c:if>

        <c:forEach begin="1" end="${requestScope.tagsPageInfo.pages}" var="i">

            <a href="#" data-pagenum="${i}"
                    <c:if test="${i eq requestScope.tagsPageInfo.pageNum}"> class="current" </c:if>>${i}</a>
        </c:forEach>

        <c:if test="${requestScope.tagsPageInfo.pageNum lt requestScope.tagsPageInfo.pages}">
            <a href="#" data-pagenum="${requestScope.tagsPageInfo.pageNum+1}">下一页</a>
        </c:if>
        <a href="#" data-pagenum="${requestScope.tagsPageInfo.pages}">尾页 </a>
        ${requestScope.tagsPageInfo.pageNum}/${requestScope.tagsPageInfo.pages}页

    </div>